Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lyft host certificate lambda Fork #43

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

luby
Copy link

@luby luby commented Apr 13, 2020

This is code patched on top of master to enable our host ssh to work. We still need to modernize the host bless client and the patches I've applied to try and fit into master and allow merging from netflix/bless master more cleanly.

Some very simple test cases added to just give us some coverage

@@ -0,0 +1,303 @@
"""
.. module: bless.aws_lambda.bless_lambda
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copied almost entirely from the old forked version that was being used for hosts (about 4 years old). Its been modernized for Python3 and a few tweaks caused by changes to interfaces in the bless package, but not refactored otherwise

REGION_PASSWORD_OPTION_SUFFIX = '_password'


class BlessLyftConfig(configparser.RawConfigParser, object):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunatley, Netfllix have altered the way configs work significantly in the past 4 years. This is just mostly lifted from the old files and modernized, but we should eventually refactor to take advantage of the netflix commits

@luby
Copy link
Author

luby commented Apr 13, 2020

@skiptomyliu I'm not going to merge this, but please do take a look.

@luby
Copy link
Author

luby commented Apr 13, 2020

🔒

@luby
Copy link
Author

luby commented Apr 13, 2020

ptal @skiptomyliu @surbhishah

skiptomyliu
skiptomyliu previously approved these changes Apr 14, 2020
@skiptomyliu
Copy link
Member

I took a pass and went through comparisons of the old branch and now new. Looks good.

'System entropy was {}, which is lower than the entropy_'
'minimum {}. Using KMS to seed /dev/urandom'.format(
entropy, entropy_minimum_bits))
response = kms_client.generate_random(
Copy link
Member

@skiptomyliu skiptomyliu Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed if entropy_check is True, then kms_client will not be initialized unless ca_private_key_password is set (https://github.com/lyft/bless/pull/43/files#diff-a69a8ab6712afafbc98a768d892b3e56R206)

This seems to be the same as the old branch and seems to be operating okay. But maybe a quick additional line:

if not kms_client:
    kms_client = boto3.client('kms', region_name=region)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants